<?php
namespace app\common\model;




use think\Model;

class ActionLog extends Model
{

    public function user()
    {
        return $this->hasOne(Admins::class,'user_id','user_id');
    }

    public function getParamsAttr($value)
    {
        $data = json_decode($value,true);
        if ($data){
            return $data;
        }
        return $value;
    }
    
    public function getList($map = []){
        return $this
            ->where($map)
            ->order('id desc')
            ->paginate('',false,['query'=>request()->param()]);
    }

}